#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define PLL pair<ll,ll>
const ll N=1e5+10;
ll n,cnt=0;
ll book[N];
ll mn=1e18;
ll mx=-1e18;
vector<ll> vec;
int main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>n;
	for(ll i=1;i<=n;i++){
		ll x;
		cin>>x;
		book[x]++;
		mn=min(mn,x);
		mx=max(mx,x);
	}
	for(ll i=mn;i<=mx;i++){
		if(book[i]){
			vec.push_back(book[i]);
		}
	}
	for(ll i=1;i<vec.size();i++){
		cnt+=min(vec[i-1],vec[i]);
		vec[i]=max(vec[i-1],vec[i]);
	}
	cout<<n-cnt;
	return 0;
}